<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>demo</title>
  <script type="text/javascript" src="../vue.js"></script>
  <style>
    .one {
      width: 200px;
      height: 200px;
      background-color: aqua;
    }

    .two {
      width: 50px;
      height: 50px;
      background-color: red;
    }
  </style>
</head>

<body>
  <div id="app">
    <!-- 此时点击时会冒泡 需要阻止冒泡 -->
    <!-- capture 是成为捕获事件 -->
    <!-- self只有点击最内部是他才会执行 -->
    <div class="one" @click.self="one">
      one
      <!-- 这里在事件后添加stop就是阻止传播 -->
      <div class="two" @click.self="two">two</div>
    </div>
    <div class="one" @click="one">右键</div>
    <!-- once修饰符:一次性事件 -->
    <div @click.once="one"> dasdasdasd</div>
    <input type="text" @keyup.13="one" @contextmenu.prevent="" name="" id="">
  </div>
</body>
<script type="text/javascript">
  Vue.config.productionTip = false
  const vm = new Vue({
    el: "#app",
    methods: {
      one() {
        console.log(111);
      },
      two() {
        console.log(222);
      }
    }
  })
</script>

</html>